package com.industrial.white.controller;

import com.industrial.common.core.web.domain.AjaxResult;
import com.industrial.white.domain.EnterpriseCount;
import com.industrial.white.domain.ProDomainCount;
import com.industrial.white.service.IIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Description: 首页Controller
 * @Date 2023/8/18 13:44
 * @Author SangGuangCan
 */
@RestController
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private IIndexService indexService;

    @GetMapping("/getEnterpriseCount")
    public AjaxResult getEnterpriseCount(){
        List<EnterpriseCount> result = indexService.getEnterpriseCount();
        return AjaxResult.success(result);
    }

    @GetMapping("/getEnterprisePie")
    public AjaxResult getEnterprisePie(){
        List<Map<String,Object>> result = indexService.getEnterprisePie();
        return AjaxResult.success(result);
    }

    @GetMapping("/getEnterpriseScaleCount")
    public AjaxResult getEnterpriseScaleCount(){
        Map<String, Object> result = indexService.getEnterpriseScaleCount();
        return AjaxResult.success(result);
    }

    @GetMapping("/getEnterpriseBigType")
    public AjaxResult getEnterpriseBigType(){
        List<EnterpriseCount> result = indexService.getEnterpriseBigType();
        return AjaxResult.success(result);
    }

    @GetMapping("/getDomainCount")
    public AjaxResult getDomainCount(){
        List<ProDomainCount> domainCount = indexService.getDomainCount();
        return AjaxResult.success(domainCount);
    }
}
